#include <iostream>
#include <stdlib.h>
using namespace std;

int input(int count,char *a){
	
	count=0;
	for (int i=0;i<100;i++){
		*(a+i)=getchar();
		if(*(a+i)=='\n')
			break;
		count++;
	}
	return count;
}
void output(char *s,int count){
	for (int i=0;i<count;i++){
		cout<<*(s+i);
	}
}
void split(char *s,int count){
	for (int i=0;i<count;i++){
		if(s[i]==' '||s[i]==','||s[i]=='.'||s[i]=='?'||s[i]=='!'){
			if(s[i+1]==' '||s[i+1]==','||s[i+1]=='.'||s[i+1]=='?'||s[i+1]=='!'){
				continue;
			}
			cout<<endl;
			continue;
		}
		cout<<s[i];
	}
}
int main (void){
	
	int count;
	
	char *a=(char *)malloc(sizeof(char *)); 
	count=input(count,a);
	split(a,count);
	return 0;
}
